package samplegameplugin;

import java.util.Calendar;
import java.util.Random;

import gamefw.framework.Coordinate;
import gamefw.gameplugin.AbstractPlayer;
import gamefw.gameplugin.GameBoard;
import gamefw.gameplugin.PlayResult;
import gamefw.uiplugin.IInputManager;

public class SampleComputerPlayer extends AbstractPlayer {
	
	private Random random;
	
	public SampleComputerPlayer() {
		random = new Random(Calendar.getInstance().getTime().getTime());
	}

	@Override
	public PlayResult play(GameBoard board, IInputManager inputManager) {
		Coordinate[] emptyPositions = board.getEmptyPositions();
		return new PlayResult(emptyPositions[this.random.nextInt(emptyPositions.length)]);
	}

}
